<template>
  <div>
    <el-form :inline="true" :model="settingForm" class="demo-form-inline">
      <el-form-item label="发动机类型">
        <el-select v-model="settingForm.engine" placeholder="请选择发动机类型">
          <el-option label="E4" value="E4"></el-option>
          <el-option label="TAE" value="TAE"></el-option>
          <!-- 如果以后以那种TAE+E4的可以这样写 -->
          <!-- <el-option label="TAE+E4" value="TAE+E4"></el-option> -->
        </el-select>
      </el-form-item>
      <el-form-item label="航电系统类型">
        <el-select v-model="settingForm.ata22Type" placeholder="">
          <el-option label="KAP140" value="KAP140"></el-option>
          <el-option label="GFC700" value="GFC700"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="考生姓名">
        <el-input
          v-model="settingForm.name"
          placeholder="请输入考生姓名"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import SettingQuestionApi from "@/api/questionItem/settingQuestion";
export default {
  data() {
    return {
      settingForm: {
        engine: "",
        ata22Type: "",
        name: "",
      },
    };
  },
  methods: {
    onSubmit: async function () {
      const engine = this.settingForm.engine;
      const ata22Type = this.settingForm.ata22Type;
      const name = this.settingForm.name;
      if (engine == "" || ata22Type == "" || name == "") {
        this.$message.error("发动机和航电系统类型和姓名不能为空！");
        return;
      }
      SettingQuestionApi.setDa42Questions(engine, ata22Type,name);
    },
  },
};
</script>

<style scoped>
</style>